* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/


* Open dataset
use 01_data/cses2_3.dta, clear

* Run analyses
regr like_party pp_dummy, cluster(respondent_code)
est store like_party_1
estadd local  Sample "All parties"

regr like_party pp_dummy if cses_wave == 2, cluster(respondent_code)
est store like_party_2
estadd local  Sample "All parties"

regr like_party pp_dummy if cses_wave == 3, cluster(respondent_code)
est store like_party_3
estadd local  Sample "All parties"

regr like_party pp_dummy if center_right == 1, cluster(respondent_code)
est store like_party_4
estadd local  Sample "Center-right parties"

regr like_party pp_dummy if center_right == 1 &  cses_wave == 2, cluster(respondent_code)
est store like_party_5
estadd local  Sample "Center-right parties"

regr like_party pp_dummy if center_right == 1 &  cses_wave == 3, cluster(respondent_code)
est store like_party_6
estadd local  Sample "Center-right parties"

* Make table
esttab like_party_1 like_party_2 like_party_3 like_party_4 like_party_5 like_party_6 using 03_tables/table1.tex, tex se replace mtitles ("CSES Waves 2 and 3" "CSES Wave 2" "CSES Wave 3" "CSES Waves 2 and 3" "CSES Wave 2" "CSES Wave 3" "CSES Waves 2 and 3" "CSES Wave 2" "CSES Wave 3") keep(pp_dummy _cons) coeflabels (pp_dummy "PP (dummy)" _cons "Constant") s(Sample, label("Sample")) star(* 0.10 ** 0.05 *** 0.01) addnotes("Standard errors are clustered by respondent") scalars(e(N))
